package com.ruoyi.spectrum.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.SNUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.spectrum.mapper.SampleSpectrumDfbMapper;
import com.ruoyi.spectrum.domain.SampleSpectrumDfb;
import com.ruoyi.spectrum.service.ISampleSpectrumDfbService;

/**
 * 干燥流化床车间样品光谱Service业务层处理
 * 
 * @author weihanqiang
 * @date 2025-05-02
 */
@Service
public class SampleSpectrumDfbServiceImpl implements ISampleSpectrumDfbService 
{
    @Autowired
    private SNUtil snUtil;

    @Autowired
    private SampleSpectrumDfbMapper sampleSpectrumDfbMapper;

    /**
     * 查询干燥流化床车间样品光谱
     * 
     * @param sampleSpectrumDfbId 干燥流化床车间样品光谱主键
     * @return 干燥流化床车间样品光谱
     */
    @Override
    public SampleSpectrumDfb selectSampleSpectrumDfbBySampleSpectrumDfbId(Long sampleSpectrumDfbId)
    {
        return sampleSpectrumDfbMapper.selectSampleSpectrumDfbBySampleSpectrumDfbId(sampleSpectrumDfbId);
    }

    /**
     * 查询干燥流化床车间样品光谱列表
     * 
     * @param sampleSpectrumDfb 干燥流化床车间样品光谱
     * @return 干燥流化床车间样品光谱
     */
    @Override
    public List<SampleSpectrumDfb> selectSampleSpectrumDfbList(SampleSpectrumDfb sampleSpectrumDfb)
    {
        return sampleSpectrumDfbMapper.selectSampleSpectrumDfbList(sampleSpectrumDfb);
    }

    /**
     * 新增干燥流化床车间样品光谱
     * 
     * @param sampleSpectrumDfb 干燥流化床车间样品光谱
     * @return 结果
     */
    @Override
    public int insertSampleSpectrumDfb(SampleSpectrumDfb sampleSpectrumDfb)
    {
        String sample_spectrum_dfb_no = snUtil.generateSN("sample_spectrum_dfb", "sample_spectrum_dfb_no", "yyyyMMdd", "ZLB", 4);
        sampleSpectrumDfb.setSampleSpectrumDfbNo(sample_spectrum_dfb_no);
        sampleSpectrumDfb.setCreateTime(DateUtils.getNowDate());
        return sampleSpectrumDfbMapper.insertSampleSpectrumDfb(sampleSpectrumDfb);
    }

    /**
     * 修改干燥流化床车间样品光谱
     * 
     * @param sampleSpectrumDfb 干燥流化床车间样品光谱
     * @return 结果
     */
    @Override
    public int updateSampleSpectrumDfb(SampleSpectrumDfb sampleSpectrumDfb)
    {
        return sampleSpectrumDfbMapper.updateSampleSpectrumDfb(sampleSpectrumDfb);
    }

    /**
     * 批量删除干燥流化床车间样品光谱
     * 
     * @param sampleSpectrumDfbIds 需要删除的干燥流化床车间样品光谱主键
     * @return 结果
     */
    @Override
    public int deleteSampleSpectrumDfbBySampleSpectrumDfbIds(Long[] sampleSpectrumDfbIds)
    {
        return sampleSpectrumDfbMapper.deleteSampleSpectrumDfbBySampleSpectrumDfbIds(sampleSpectrumDfbIds);
    }

    /**
     * 删除干燥流化床车间样品光谱信息
     * 
     * @param sampleSpectrumDfbId 干燥流化床车间样品光谱主键
     * @return 结果
     */
    @Override
    public int deleteSampleSpectrumDfbBySampleSpectrumDfbId(Long sampleSpectrumDfbId)
    {
        return sampleSpectrumDfbMapper.deleteSampleSpectrumDfbBySampleSpectrumDfbId(sampleSpectrumDfbId);
    }
}
